<div class="container">

    <div class="page-header">
        <div class="row">
            <h1 class="span8"><? if($post_action=='EDIT'){ echo 'Edit';}else echo 'Add';?> <?=ucfirst($post_type)?></h1>
            <span class="span4">

            </span>
        </div>


    </div>

    <ul class="nav nav-tabs">
        <li><a href="#home" data-toggle="tab">General</a></li>
        <li><a href="#profile" data-toggle="tab">Price List</a></li>
        <li><a href="#messages" data-toggle="tab">Reservations</a></li>
        <li><a href="#settings" data-toggle="tab">Suplier reports</a></li>
        <li><a href="#settings" data-toggle="tab">Description</a></li>
        <li><a href="#settings" data-toggle="tab">Category</a></li>
        <li><a href="#settings" data-toggle="tab">SEO</a></li>
        <li><a href="#settings" data-toggle="tab">Availability</a></li>
    </ul>

    <div class="row">

        <div class="span12">

            <form class="form-horizontal form-qtrans" id="post" method="post" action="javascript:" name="post">

                <input type="hidden" value="<?=$post_type;?>" name="post_type" id="post_type">
                <input type="hidden" value="<?=$post_action;?>" name="post_action" id="post_action">

                <?        
                    if($post_action=='EDIT'){?>
                    <input type="hidden" value="<?=$post['ID'];?>" name="post_ID" id="post_ID">
                    <?}
                ?>

                <fieldset>


                    <div class="control-group">
                        <label class="control-label">Owner</label>
                        <div class="controls docs-input-sizes">

                            <select class="span3">
                                <option value="0">--Please Select</option>
                                <? foreach($owners as $owner): ?>
                                    <option value="<?=$owner['ID']?>"><?=$owner['name'].' '.$owner['surname'];?></option>
                                    <? endforeach; ?>

                            </select>
                            <p class="help-block">Please select Object Owner.</p>
                        </div>
                    </div>

                    

                    <div class="control-group">
                        <label for="optionsCheckboxList" class="control-label">Facilities</label>
                        <div class="controls">

                            <? foreach($facilities as $facility): ?>

                                <div class="facility-group">

                                    <p class="help-block mtop-5"><strong><?=$facility['post_title']?>:</strong></p>

                                    <? $childrens = $this->objects_model->view_post_children( $facility['ID'], 'facility'); ?>

                                    <? foreach($childrens as $children): ?>

                                        <label class="checkbox">
                                            <input type="checkbox" value="option1" name="optionsCheckboxList1">
                                            <?=$children['post_title']?>
                                        </label>

                                        <? endforeach; ?>

                                </div>

                                <? endforeach; ?>


                        </div>
                    </div>

                    <div class="form-actions">

                        <div class="row">
                            <span class="span2 save"><button class="btn btn-primary" type="submit">Save changes</button></span>
                            <span class="span6 loader"><img id="ajax-loading" class="ajax-loading" src="<?=base_url()?>assets/img/backgnds/loading.gif" style="visibility: hidden;"></span>
                        </div>

                    </div>

                </fieldset>
            </form>

        </div>

    </div>

</div> <!-- /container -->